package demo4;

public class OuterClass1 {
    public int data1 = 1;
    private int data2 = 2;
    public static final int DATA3 = 4;

    // 实例内部类
    class InnerClass{
        public int data1 = 1111111;
        public int data4 = 4;
        private int data5 = 5;
        public static final int DATA6 = 6;

        public void InnerTest(){
            System.out.println("内部类的方法被执行了");

            System.out.println(data1);
            System.out.println(OuterClass1.this.data1);
            System.out.println(data2);
            System.out.println(DATA3);
            System.out.println(data4);
            System.out.println(data5);
            System.out.println(DATA6);
            test();
        }
    }

    public void test(){
        System.out.println("外部类的方法执行了...");
    }
}
